Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect: Use elf_aux_info instead of mrs on aarch64 FreeBSD #77

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented Feb 23, 2023

Our (unreleased) current feature detection code and is_aarch64_feature_detected (as of nightly-2023-01-23) always use mrs on aarch64 FreeBSD. However, they do not work on FreeBSD 12 on QEMU (confirmed on FreeBSD 12.{2,3,4}), and we got SIGILL (worked on FreeBSD 13 and 14).

So use elf_aux_info instead of mrs like compiler-rt does.
https://man.freebsd.org/elf_aux_info(3)
https://reviews.llvm.org/D109330

@taiki-e taiki-e added the O-arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state label Feb 23, 2023
Our (unreleased) current feature detection code and
`is_aarch64_feature_detected` (as of nightly-2023-01-23) always use
`mrs` on aarch64 FreeBSD. However, they do not work on FreeBSD 12 on
QEMU (confirmed on FreeBSD 12.{2,3,4}), and we got SIGILL (worked on
FreeBSD 13 and 14).

So use `elf_aux_info` instead of `mrs` like `compiler-rt` does.
https://man.freebsd.org/elf_aux_info(3)
https://reviews.llvm.org/D109330
@taiki-e taiki-e merged commit fe84be8 into main Feb 23, 2023
@taiki-e taiki-e deleted the aarch64-freebsd-auxv branch February 23, 2023 07:55
@taiki-e taiki-e added O-aarch64 Target: Armv8-A, Armv8-R, or later processors in AArch64 mode and removed O-arm Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-aarch64 Target: Armv8-A, Armv8-R, or later processors in AArch64 mode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant